package com.xishu.controller;

import com.xishu.entity.shop.ShopFlag;
import com.xishu.response.ResponseData;
import com.xishu.response.VerifyUtil;
import com.xishu.service.CommonService;
import com.xishu.util.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Api(description = "分店的标记，当前只有闭店报告是否已经打印了")
@RestController
public class ShopFlagController {

    @ApiOperation(value = "查询闭店报告")
    @PutMapping(value = ("/shop/flag"), produces = ("application/json;charset=UTF-8"))
    public ResponseData list(@RequestBody ShopFlag shopFlag) throws Exception {
        VerifyUtil.verify(() -> shopFlag.getShopId() != null);
        shopFlag.setFlagTime(DateUtil.formatDayDate(System.currentTimeMillis()));
        return CommonService.getInstance().searchResponse(shopFlag);
    }
}
